package net.yxsoft.controller.pc.sysmgt.common.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import net.yxsoft.resource.PathRes;
import rapid.core.Authuser;

public class AuthInterceptor implements Interceptor {
 /**
 * @MethodName: intercept
 * @Description:
 * @param: inv
 * @return void
 * @throws
 * @date 2023/8/31 15:36
 * @author jhf
 */
  @Override
  public void intercept(Invocation inv) {


    if(inv.getController().getSessionAttr(Authuser.KEY_USER) != null) {
      inv.invoke();
    } else {
        inv.getController().redirect(PathRes.URL_PC_MGT_ROOT);
    }
  }
}
